import { useState } from "react";

const style = {
     background: "red",
     width:"600px",
     height:300

};
function SubCom({user,id,sendData}:any) {

    const [name] = useState("张三");
 
    console.log(user);
    console.log(id);

    // const clickHandle = () => {

    //     sendData("aaaaaaaaaaaaa")
    // }
    
    
  return (
    <div style={style}>
      <div>子组件

        <button onClick={()=>sendData(name)}>给子组件传值</button>
      </div>
    </div>
  );
}
export default SubCom;